package com.pc.mapper;

import com.pc.enrty.Food;
import com.pc.enrty.Viewed;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface ViewedMapper {
    /**
     * 根据uid查询浏览商品
     * @param viewed
     * @return
     */
    ArrayList<Food> selectViewed(Viewed viewed);

    /**
     * 查询是否有重复
     * @param viewed
     * @return
     */
    ArrayList<Food> selectByUidAndFid(Viewed viewed);

    /**
     * 插入最近浏览商品
     * @param viewed
     * @return
     */
    int insertViewed(Viewed viewed);

    /**
     * 根据uid保留五条浏览记录,删除多余的记录
     * @param viewed
     * @return
     */
    int deleteViewed(Viewed viewed);

}
